<template>
  <div v-loading="pageLoading">
    <div class="filter-container">
      <el-input style="width: 300px" placeholder="料号/物料名/物料序号" clearable prefix-icon="el-icon-search"
        class="filter-item" @keyup.enter.native="research" @clear="research" v-model="query.queryString.kpn"></el-input>
      <el-button class="filter-item" type="success" plain @click="research">查询</el-button>
    </div>
    <z-table :list="list" :tableProps="tableProps" :columns="columns"> </z-table>
    <z-pagination :pagination="pagination" :total="total" :page.sync="query.page" :limit.sync="query.size"
      @change="getList"></z-pagination>
  </div>
</template>

<script>
import commonMixin from '@/views/_common/mixin'
export default {
  mixins: [commonMixin],
  props: {
    sn: {
      type: String,
      default: '',
    },
  },
  watch: {
    sn: {
      handler(n, o) {
        if (n) {
          this.query.queryString.sn = n
          this.getList()
        } else {
          this.list = []
          this.total = 0
        }
      },
      immediate: true,
    },
  },
  data() {
    return {
      tableProps: {
        hideOperations: true,
      },
      api: this.$api.wipkpsReport,
      query: {
        queryString: {
          kpn: null,
          sn: null,
        },
        page: 1,
        size: 10,
      },
      columns: [
        { title: '工单流水号', key: 'serial_number', width: 180 },
        { title: '料号', key: 'key_part_no', width: 120 },
        { title: '物料序号', key: 'key_part_sn', width: 180 },
        { title: '线别', key: 'line_name', width: 140 },
        { title: '工序', key: 'group_name', width: 90 },
        { title: '扫描时间', key: 'pick_up_time', width: 140 },
        { title: '数量', key: 'qty', width: 60 },
        { title: '替代群组', key: 'alternative', width: 80 },
        { title: '物料名称', key: 'key_part_name', width: 140 },
        { title: '物料描述', key: 'key_part_desc', width: 150 },
        { title: '备注', key: 'remarks', width: 140 },
      ],
    }
  },
  created() {},
}
</script>

<style>
</style> 